<clr-modal [(clrModalOpen)]="opened" [clrModalSize]="'lg'">
  <h3 class="modal-title">升级</h3>
  <div class="modal-body">
    <p class="p7 prompt">版本升级只能在小版本之前进行 例如:1.16.1 升级到1.16.2 不能从1.15升级到1.16</p>
    <form clrForm #form='ngForm'>
      <clr-select-container>
        <label>目标版本: </label>
        <select clrSelect name="package" [(ngModel)]="newPackage" required>
          <option value="">请选择</option>
          <option *ngFor="let package of packages" [ngValue]="package">{{package.name}}</option>
        </select>
      </clr-select-container>
    </form>
    <table class="table table-vertical" *ngIf="newPackage">
      <tbody>
      <tr>
        <th>组件名称</th>
        <td>当前版本</td>
        <td>目标版本</td>
      </tr>
      <tr>
        <th>kubernetes</th>
        <td>{{currentPackage.meta.vars['kube_version']}}</td>
        <td>{{newPackage.meta.vars['kube_version']}}</td>
      </tr>
      <tr>
        <th>etcd</th>
        <td>{{currentPackage.meta.vars['etcd_version']}}</td>
        <td>{{newPackage.meta.vars['etcd_version']}}</td>
      </tr>
      <tr>
        <th>docker</th>
        <td>{{currentPackage.meta.vars['docker_version']}}</td>
        <td>{{newPackage.meta.vars['docker_version']}}</td>
      </tr>
      </tbody>
    </table>
  </div>
  <div class="modal-footer">
    <button type="button" class="btn btn-outline" (click)="close()">取消</button>
    <button type="button" class="btn btn-primary" [disabled]="form.invalid" (click)="onConfirm()">确认</button>
  </div>
</clr-modal>
